import React, {Component} from 'react'
import Info from './User/Info.js'
import Main from './User/Main.js'
import {BrowserRouter as Router, Route, Link} from 'react-router-dom'


class User extends Component {
    constructor(props) {
        super(props);
        this.state = {  };
    }
    ///   {/  <input type="text" value={`${this.props.match.url}/main`}/>  /}
    //  {/  <Route exact path="/user/" component={Info}/>
     //                   <Route  path={`${this.props.match.url}/main`} component={Main}/>  /}  /
    render() {
        return (
            <Router>
               <div className="content">
                    <div className="left">
                    <Link to="/user/main">个人中心</Link>
                    <br/><br/>
                    <Link to="/user/">用户信息</Link>
                    
                    </div>
                    <div className="right">
                      
                        {
                            this.props.routes.map((route, key) => {
                                if(route.exact){
                                    return <Route key={key} exact path={route.path} component={route.component}/>
                                }else {
                                    return <Route key={key} path={route.path} component={route.component}/>
                                }
                            })
                        }
                    </div>
                </div>
            </Router>
        );
    }
}

export default User;